﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HarmonyLib;
using UnityEngine;
public class ET_Initializer : IModApi
{
    private static readonly object lockObject = new object();
    public void InitMod(Mod _modInstance)
    {
        Harmony harmony = new Harmony(base.GetType().Name);
        harmony.PatchAll();
        ModEvents.GameStartDone.RegisterHandler(async delegate
        {
            ET_ConfigManager.QuestPOITeleData cfgDataTable = await ET_ConfigManager.ReadCfgData();
            lock (lockObject)
            {
                ET_ModuleLogic.minDistanceTeleTo = cfgDataTable.MinDistanceToTele;
                ET_ModuleLogic.waitToHandleAction = cfgDataTable.WaitToHandleActionSec;
                ET_ModuleLogic.isAvailableInBM = cfgDataTable.IsAvailableInBM;
                ET_ModuleLogic.globalBroadcastEnable = cfgDataTable.GlobalBroadcastEnable;
                ET_ModuleLogic.key_ChatCmdBackPos = cfgDataTable.ChatCmdApiRequestBack;
            }
        });
    }
}
